﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Dxr.Police.IACS.Models;

namespace Dxr.Police.IACS.FullText
{
    public class JJSJSource : DataSourceBase<Models.JJSJ>
    {
        public JJSJSource() : base()
        {
        }

        protected override void OnResultBuilded(JJSJ t, FullTextModel model)
        {
            base.OnResultBuilded(t, model);

            var lon = "";
            var lat = "";
            if (!string.IsNullOrEmpty(t.zuobiao))
            {
                var nums = t.zuobiao.Split(',');
                lon = nums[0];
                lat = nums[1];
            }

            model.Longitude = lon;
            model.Latitude = lat;
            model.ShowPoint = !string.IsNullOrEmpty(lon) && !string.IsNullOrEmpty(lat);
        }

        public override int ImportFromExcel(string path, DataType type, Dxr.Police.Models.UserInfo user)
        {
            throw new ImportException("该项数据不允许导入");
        }
    }
}
